home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / weight.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  85 lines

  1. WEIGHT, a Weighted MEAN and SDEV, by Joseph K. Horn 
  2.  
  3. Sean F Kellner writes: 
  4.  
  5. > I have come to a small problem with my HP48sx that I haven't heard 
  6. > anyone else complain of yet.  How do you get the statistics function 
  7. > to do weighted means and standard deviations?  I tried the matrix 
  8. > editor and put the data in col 1 and the frequency in column two. 
  9. > When I hit the mean button it gave me the average of each column. 
  10. > Same for standard deviation.  I needed this done real soon at the 
  11. > time so I decided to enter each number in separately, all 200 of 
  12. > them instead of about 11 discrete values.  I ended up writing a 
  13. > small "program" that simply made whatever I typed in a 1 element 
  14. > array and typed the number in, hit that key, then return for the 
  15. > rest of the frequency. I then did a 198 ->list and edited the  { } 
  16. > to be [ ] because -> wouldn't work with arrays. This can't be the 
  17. > easiest way of doing this, anyone give me a hint? Although this did 
  18. > work, I can only imagine what people thought when I was counting how 
  19. > many times I tapped my calculator.  I would RTFM but the they are 
  20. > still in Columbus and I am now a freshman in Cincinnati. 
  21.  
  22. Two solutions come to mind: 
  23.  
  24. (1)  If you can sometimes be happy with just the weighted MEAN, use: 
  25.  
  26.      'WTAV'  ( WeighTed AVerage ) 
  27.    +----------------------------------+ 
  28.    | <<  OVER  DOT  SWAP  CNRM  /  >> | 
  29.    +----------------------------------+ 
  30.  
  31.      INSTRUCTIONS: Type the weight array, then the data array, and 
  32.      press WTAV; the weighted average is instantly computed. 
  33.  
  34.      2: [ weights ] 
  35.      1: [ data ]     -->  WTAV  -->  1: weighted mean 
  36.  
  37.      EXAMPLE:  You got a 75%, an 80%, and an 85% on three tests (each 
  38.      worth 20% of your class grade), and then you got a 90% on the 
  39.      final exam (worth 40% of your class grade).  What is your grade? 
  40.  
  41.      SOLUTION: 
  42.  
  43.      2: [ 20 20 20 40 ] 
  44.      1: [ 75 80 85 90 ]    -->  WTAV  -->  84  (You got an 84%) 
  45.  
  46.  
  47. (2)  If you really need SDEV (and the other STAT functions), then have 
  48.      the HP 48 press the ä+ (Sigma+) key for you: 
  49.  
  50.      'SSIG'  ( Super-ä ) 
  51.    +-------------------------------------------------+ 
  52.    | <<  1  SWAP  START  ä+  LASTARG  NEXT  DROP  >> | 
  53.    +-------------------------------------------------+ 
  54.      (Note: "ä+" = [STAT] [A] ) 
  55.  
  56.      INSTRUCTIONS: Use the normal CLä and ä+ function to input the very 
  57.      first datum (a single number or an array of any size).  From then 
  58.      on, enter your data (brackets are optional) followed by the 
  59.      weight, and press SSIG.  The HP 48 will press ä+ for you, that 
  60.      many times.  When data entry is finished, use the STAT functions 
  61.      as usual. 
  62.  
  63.      EXAMPLE: One of my students got 100%, four got 92%, twelve got 
  64.      84%, eleven got 76%, six got 68%, and two got 60%.  What is the 
  65.      mean and standard deviation of these grades? 
  66.  
  67.      SOLUTION: 
  68.  
  69.      [STAT] 
  70.      CLä 
  71.      100 ä+ 
  72.      [VAR] 
  73.      92  4 SSIG 
  74.      84 12 SSIG 
  75.      76 11 SSIG 
  76.      68  6 SSIG 
  77.      60  2 SSIG 
  78.      [blue-STAT] 
  79.      MEAN   -->  78.89 
  80.      SDEV   -->   9.20 
  81.  
  82. Of course, if you REALLY want to input your data as [ datum weight ] 
  83. pairs, and THEN massage it into useable form, that would require a 
  84. program too.  But it'd be a little larger than the programs above. 
  85.